home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / OutOfPhase1.01Source / OutOfPhase Folder / Level 0 Macintosh 07Aug94 / Menus.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-01  |  3.1 KB  |  91 lines  |  [TEXT/KAHL]

  1. /* Menus.h */
  2.  
  3. #ifndef Included_Menus_h
  4. #define Included_Menus_h
  5.  
  6. /* Menus module depends on: */
  7. /* MiscInfo.h */
  8. /* Audit */
  9. /* Debug */
  10. /* Definitions */
  11. /* Memory */
  12. /* Array */
  13.  
  14. /* structure representing a menu */
  15. struct MenuType;
  16. typedef struct MenuType MenuType;
  17.  
  18. /* structure representing a menu item */
  19. struct MenuItemType;
  20. typedef struct MenuItemType MenuItemType;
  21.  
  22. /* Initialize the menu subsystem.  This must be called before any menu routines */
  23. /* are used.  It is local to Level 0 and called from module Screen (InitializeScreen) */
  24. /* and should not be called from anywhere else. */
  25. MyBoolean                            Eep_InitializeMenus(void);
  26.  
  27. /* Destroy any menu stuff that needs to be cleaned up before the program quits. */
  28. /* this should not be called from anywhere else except ShutdownScreen */
  29. void                                    Eep_ShutdownMenus(void);
  30.  
  31. /* create an implementation defined "utility" menu.  On the Macintosh, this is */
  32. /* the standard "Apple Menu". */
  33. MenuType*                            MakeAppleMenu(void);
  34.  
  35. /* create a new menu with the specified name.  The menu will not */
  36. /* be displayed on the menu bar */
  37. MenuType*                            MakeNewMenu(char* MenuName);
  38.  
  39. /* hide a menu if it's on the menu bar and delete it and all of the items */
  40. /* it contains. */
  41. void                                    KillMenuAndDeleteItems(MenuType* TheMenu);
  42.  
  43. /* post a menu to the menu bar if it isn't already there */
  44. void                                    ShowMenu(MenuType* TheMenu);
  45.  
  46. /* remove a menu from the menu bar if it is there */
  47. void                                    HideMenu(MenuType* TheMenu);
  48.  
  49. /* append a new item to an existing menu.  The Shortcut specifies a key that */
  50. /* can be used instead of pulling down the menu.  How this is done and which */
  51. /* keys are allowed are implementation defined.  On the Macintosh, the Command */
  52. /* key is used; keys should be numbers or upper case letters.  If two menu items */
  53. /* are specified with the same shortcut, the result is undefined. */
  54. /* by default, the item is greyed out (disabled). */
  55. MenuItemType*                    MakeNewMenuItem(MenuType* TheMenu, char* MenuItemName,
  56.                                                 char Shortcut);
  57.  
  58. /* delete the specified item from the menu. */
  59. void                                    KillMenuItem(MenuItemType* TheItem);
  60.  
  61. /* enable a menu item. Items may only be selected if enabled. */
  62. void                                    EnableMenuItem(MenuItemType* TheItem);
  63.  
  64. /* disable a menu item. */
  65. void                                    DisableMenuItem(MenuItemType* TheItem);
  66.  
  67. /* Set an implementation defined mark to indicate that the menu item has been */
  68. /* persistently selected.  On the Macintosh, this places a checkmark to the left */
  69. /* of the name of the menu item */
  70. void                                    SetItemCheckmark(MenuItemType* TheItem);
  71.  
  72. /* remove the implementation defined mark */
  73. void                                    ClearItemCheckmark(MenuItemType* TheItem);
  74.  
  75. /* change the name of a menu item */
  76. void                                    ChangeItemName(MenuItemType* TheItem, char* NewName);
  77.  
  78. /* Add an implementation defined "separator" to the end of the menu.  On the */
  79. /* Macintosh, this separator is a grey line. */
  80. void                                    AppendSeparator(MenuType* TheMenu);
  81.  
  82. /* Disable all menu items, remove any checkmarks */
  83. void                                    WipeMenusClean(void);
  84.  
  85.  
  86. /* private routines; These are not available for general use. */
  87. MenuItemType*                    Eep_MMID2ItemID(long MMID);
  88. void                                    Eep_RedrawMenuBar(void);
  89.  
  90. #endif
  91.